refactor: JSON converter improvements#29
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JsonConverterkeyword coverage — refactored from per-type duplicated keyword blocks to a sharedapplyCommonKeywords()pipeline, ensuring every schema type receives full coverage for$comment,examples,deprecated,readOnly,writeOnly,enum,const,default,format,$ref,$anchor,allOf/anyOf/oneOf/not,if/then/else, and$defs/definitionsdependentRequired(onHasProperties),tupleItems+additionalItems(onHasItems), a newHasAnchortrait with$anchorsupport, and aUnionSchema::typeless()factory for composition/definition-only schemas that correctly omit thetypekeywordpatternProperties,propertyNames,unevaluatedProperties,dependentSchemas,dependentRequiredprefixItems,unevaluatedItems,additionalItems, and draft-07 tuple-styleitemsarraystypekeyword that carry structural keywords ($ref,allOf,$defs,properties,required, etc.) are no longer incorrectly converted toUnionSchemawith all 7 types emittedtests/Fixtures/json-schema-org/JsonConverterFixturesTestasserts every source keyword is present in the converted output using aSchemaRoundTripsubset helper$ref,$defs,$anchor, metadata,patternProperties,propertyNames,dependentSchemas,dependentRequired,prefixItems,unevaluatedItems,additionalItems, typeless schemas, booleanconst)